<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main{
            width: 200px;
            height: 30px;
            overflow: hidden;
        }
        .test{
            width: 420px;
            height: 30px;
            background-color: pink;
        }
        .test2{
            animation: move 2s ease-in-out;
        }
        @keyframes move{
            from{
                margin-left: 0px;
            }
            to{
                margin-left: -220px;
            }
        }
    </style>
</head>
<body>
    <div class="main">
        <div class="test">
            <span>王者荣耀</span>
            <span>王者荣耀</span>
            <span>王者荣耀</span>
            <span>王者荣耀</span>
            <span>王者荣耀</span>
            <span>王者荣耀</span>
        </div>
    </div>
    <button @click="test">点击</button>
</body>
</html>